<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.active{
				color: red;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<ul>
				<li v-for="(item,index) in movies" :class="{active:item.color}" @click="steClass(index)">
					{{index}}-{{item.text}}
				</li>
			</ul>
		</div>
		<script src="../js/vue.js"></script>
		<script>
			const app=new Vue({
				el:'#app',
				data:{
					movies:[{text:'海王',color:false},{text:'海尔兄弟',color:false},{text:'火影忍者',color:false},{text:'火影忍者',color:false}]
				},
				methods:{
					steClass(index){
						this.movies[index].color=true;
					}
				}
			})
		</script>
	</body>
</html>
